import { getLevelFirst, getLevelZero, getUserID } from '@/utils';

/** 采购汇总统计数据范围 */
const contractHomeCountSwitch = (curRes: Record<string, any>) => {
  if (curRes?.['/purchaseReportController/companyID']) {
    return {
      companyID: getLevelZero(),
      params: 'companyID',
    };
  } else if (curRes?.['/purchaseReportController/departmentID']) {
    return {
      departmentID: getLevelFirst(),
      params: 'departmentID',
    };
  } else if (curRes?.['/purchaseReportController/userID']) {
    return {
      userID: getUserID(),
      params: 'userID',
    };
  } else {
    return {};
  }
};

export { contractHomeCountSwitch };
